package chixing.day14.work;

public class StringCount {
    public static void main(String[] args) {
      String str = "hello world";
        //给定一个字符串，统计其中每个字符出现的次数。
        char[] chars = str.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            int count = 0;
            for (int j = 0; j < chars.length; j++) {
                if (chars[i] == chars[j]) {
                    count++;
                }
            }
            System.out.println(chars[i] + "->" + count);
        }
    }
}
